package cp3120.model;

/**
 * A permission denotes the users ability to do a specific task.
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public class Permission {
    private int id;
    private String name;

    public Permission(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public Permission() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean equals(Object other) {
        if (!(other instanceof Permission)) {
            return false;
        }
        Permission that = (Permission)other;
        return this.id == that.id;
    }

    public String toString() {
        return name;
    }
}
